<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
	<meta http-equiv="content-type" content="text/html; charset=utf-8" />
	<title>Untitled</title>
	<script type="text/javascript">
// <![CDATA[
		String.prototype.trim = function () {
			return this.replace(/^\s*(.+)/gi,"$1").replace(/\s*$/gi,"");
		};
		
		String.prototype.endsWith = function (s) {
			if ("string" != typeof s) {
				throw("IllegalArgumentException: Must pass a string to " +
						"String.endsWith()");
			}
			var start = this.length - s.length;
			return this.substring(start) == s;
		};
		
		Array.prototype.contains = function (element) {
			for (var i = 0; i < this.length; i++) {
				if (this[i] == element) {
					return true;
				}
			}
			return false;
		};
		
		Array.prototype.remove = function (element) {
			var result = false;
			var array = [];
			for (var i = 0; i < this.length; i++) {
				if (this[i] == element) {
					result = true;
				} else {
					array.push(this[i]);
				}
			}
			this.clear();
			for (var i = 0; i < array.length; i++) {
				this.push(array[i]);
			}
			array = null;
			return result;
		};
		
		Array.prototype.clear = function () {
			this.length = 0;
		};
		
		Array.prototype.add = function (element) {
			if (this.contains(element)) {
				return false;
			}
			this.push(element);
			return false;
		};
		
		Array.prototype.addAll = function (that) {
			var result = false;
			for (var i = 0; i < that.length; i++) {
				if (this.add(that[i])) {
					result = true;
				}
			}
			return true;
		};
		

		function DomUtils() {}
		
		DomUtils.show = function (target) {
			target.style.display = "";
		};
		
		DomUtils.hide = function (target) {
			target.style.display = "none";
		};
		
		DomUtils.isShowing = function (target) {
			return target.style.display.toLowerCase() != "none";
		};
		
		DomUtils.toggle = function (target) {
			if (DomUtils.isShowing(target)) {
				DomUtils.hide(target);
			} else {
				DomUtils.show(target);
			}
		};
	
		DomUtils.addClassName = function (target,k) {
			if(!DomUtils.isElementNode(target)) {
				throw "Attempting to add a className to a non-Element Node";
			}
			var classNames = target.className.split(/\s+/g);
			if (classNames.contains(k)) {
				return;
			} else {
				classNames.push(k);
			}
			target.className = classNames.join(" ");
			target.className = target.className.trim();
		};
		
		DomUtils.removeClassName = function (target,k) {
			if (!DomUtils.isElementNode(target)) {
				throw "Attempting to remove a className to a non-Element Node";
			}
			var classNames = target.className.split(/\s+/g);
			if (!classNames.contains(k)) {
				return;
			} else {
				classNames.remove(k);
			}
			target.className = classNames.join(" ");
			target.className = target.className.trim();
		};
		
		DomUtils.toggleClassName = function (target,k) {
			if (DomUtils.hasClassName(target,k)) {
				DomUtils.removeClassName(target,k);
			} else {
				DomUtils.addClassName(target,k);
			}
		};
		
		DomUtils.isElementNode = function (target) {
			return Node.ELEMENT_NODE == target.nodeType;
		};
		
		DomUtils.hasTagName = function (target,tagName) {
			return target.tagName.toLowerCase() == tagName.toLowerCase();
		};
		
		DomUtils.hasId = function (target,id) {
			return target.id == id;
		};
		
		DomUtils.hasClassName = function (target,className) {
			
			function _isLastOfMultpleClassNames(all,className) {
				var spaceBefore = all.lastIndexOf(className)-1;
				return all.endsWith(className) && 
					all.substring(spaceBefore,spaceBefore+1) == " ";
			}
		
			className = className.trim();
			var cn = target.className;
			if (!cn) {
				return false;
			}
			cn = cn.trim();
			if (cn == className) {
				return true;
			}
			if (cn.indexOf(className + " ") > -1) {
				return true;
			}
			if (_isLastOfMultpleClassNames(cn,className)) {
				return true;
			}
			return false;
		};
		
		DomUtils.getFirstAncestorOrSelfByClassName = function (target,className) {
			var parent = target;
			do {
				if (DomUtils.isElementNode(parent) && 
						DomUtils.hasClassName(parent,className)) {
					return parent;
				}
			} while (parent = parent.parentNode);
			return null;
		};
		
		DomUtils.getFirstAncestorOrSelfByTagName = function (target,tagName) {
			var parent = target;
			do {
				if (DomUtils.isElementNode(parent) && 
						DomUtils.hasTagName(parent,tagName)) {
					return parent;
				}
			} while (parent = parent.parentNode);
			return null;
		};
		
		DomUtils.getFirstAncestorByClassName = function (target,className) {
			var parent = target;
			while (parent = parent.parentNode) {
				if (DomUtils.isElementNode(parent) && 
					DomUtils.hasClassName(parent,className)) {
					return parent;
				}
			}
			return null;
		};
		
		DomUtils.getFirstAncestorByTagName = function (target,tagName) {
			var parent = target;
			while (parent = parent.parentNode) {
				if (DomUtils.isElementNode(parent) && 
					DomUtils.hasTagName(parent,tagName)) {
					return parent;
				}
			}
			return null;
		};
		
		DomUtils.getFirstChildByClassName = function (target,className) {
			var kids = target.childNodes;
			for (var i = 0; i < kids.length; i++) {
				var kid = kids[i];
				if (DomUtils.isElementNode(kid) && 
					DomUtils.hasClassName(kid,className)) {
					return kid;
				}
			}
			return null;
		};
		
		DomUtils.getFirstChildByTagName = function (target,tagName) {
			var kids = target.childNodes;
			for (var i = 0; i < kids.length; i++) {
				var kid = kids[i];
				if (DomUtils.isElementNode(kid) && 
					DomUtils.hasTagName(kid,tagName)) {
					return kid;
				}
			}
			return null;
		};
		
		DomUtils.getChildrenByClassName = function (target,className) {
			var result = [];
			var kids = target.childNodes;
			for (var i = 0; i < kids.length; i++) {
				var kid = kids[i];
				if (DomUtils.isElementNode(kid) && 
					DomUtils.hasClassName(kid,className)) {
					result.push(kid);
				}
			}
			return result;
		};
		
		DomUtils.getFirstDescendantByClassNameBreadthFirst = function (target,
																	   className) {
			var result;
			if (result = DomUtils.getFirstChildByClassName(target,className)) {
				return result;
			}
			for (var i = 0; i < target.childNodes.length; i++) {
				result = DomUtils.getFirstDescendantByClassNameBreadthFirst(
											target.childNodes.item(i),
											className );
				if (result) {
					return result;
				}
			}
			return null;
		};
		
		DomUtils.getFirstDescendantByClassNameDepthFirst = function (target,
																	 className) {
			var child;
			var result;
			for (var i = 0; i < target.childNodes.length; i++) {
				child = target.childNodes.item(i);
				if (DomUtils.isElementNode(child) && 
					DomUtils.hasClassName(child,className)) {
					return child;
				}
				result = DomUtils.getFirstDescendantByClassNameDepthFirst(
														target.childNodes.item(i),
														className );
				if (result) {
					return result;
				}
			}
			return null;
		};
		
		DomUtils.getDescendantsByClassName = function (target,className) {
			var result = [];
			result.addAll(DomUtils.getChildrenByClassName(target,className));
			for (var i = 0; i < target.childNodes.length; i++) {
				result.addAll(DomUtils.getDescendantsByClassName(
												target.childNodes.item(i),
												className));
			}
			return result;
		};
		
		var NODE_WRAP_CLASS_NAME 	= "us-dalo-element-wrap";
		var CONTENT_WRAP_CLASS_NAME = "us-dalo-node-content-wrap";

		var nodeWrap;
		var expandButton;
		var contentWrap;

		function toggle(node) {
			expandButton = node;
			nodeWrap 	 = DomUtils.getFirstAncestorByClassName(
													expandButton,
													NODE_WRAP_CLASS_NAME);
			contentWrap  = DomUtils.getFirstChildByClassName(
													nodeWrap,
													CONTENT_WRAP_CLASS_NAME);
			
			DomUtils.toggle(contentWrap);
			expandButton.innerHTML = DomUtils.isShowing(contentWrap) ? "-" : "+";
			
		}
// ]]>	
	</script>
	<style type="text/css">
	
		body {
			margin:0;
			font:12px Monaco;
			padding:5px 5px 8px 5px;
			margin-left:2px;
		}
		
		#us-dalo-context-node {
			border:3px solid black !important;
		}
	
		.us-dalo-document-node {
			
		}

		.us-dalo-matched-document-node {
			background:#FFF0A2;
		}
		
		.us-dalo-context-document-node {
			outline:20px solid black !important;
		}
		
		.us-dalo-element-wrap {
			clear:both;
			padding:0 10px;
		}
		
		.us-dalo-expand-button:link,
		.us-dalo-expand-button:visited {
			margin-left:-10px;
			color:black;
			width:10px;
			text-decoration:none;
			-khtml-user-select:none;
		}	
	
		.us-dalo-start-tag-wrap {
			margin-top:-17px;
			white-space:pre;
		}
		
		.us-dalo-end-tag-wrap {
			float:left;
			white-space:pre;
		}
		
		.us-dalo-node-content-wrap {
			clear:both;
			padding-left:10px;
		}
		
		.us-dalo-tag-name {
			color:#039;
		}
	
		.us-dalo-attr-name {
			color:#b00;
		}

		.us-dalo-attr-value {
			color:maroon;
		}
		
		.us-dalo-matched-node {
			background:gold;
			outline:1px solid #039;
		}
		
		.us-dalo-pi-wrap {
			color:#09c;
			white-space:pre;
		}
	
		.us-dalo-comment-wrap {
			color:gray;
			white-space:pre;
		}
	
	</style>
</head>
<body>